<template>
  <div class="lookResume">
    <Header />
    查看简历
    <div class="lookResume-upload">
      <el-upload
        class="avatar-uploader"
        action=""
        :auto-upload="false"
        :http-request="add"
        :show-file-list="false"
      >
        <img v-if="imageUrl" :src="imageUrl" class="avatar" />
        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
      </el-upload>
       <!-- <el-upload
            style="margin-left: 50px"
            list-type="picture-card"
            :http-request="uploadImgEdit"
            action
            :limit="1"
          >
          </el-upload> -->
    </div>
  </div>
</template>

<script>
import Header from '../../components/Header/index'
export default {
  name: 'lookResume',
  components: { Header },
  data() {
    return {
      imageUrl: '',
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    add() {
      // console.log(123);
    },
    changeimg(file) {
      // console.log( file);
    },
    handleAvatarSuccess(res, file) {
      this.imageUrl = URL.createObjectURL(file.raw)
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === 'image/jpeg'
      const isLt2M = file.size / 1024 / 1024 < 2

      if (!isJPG) {
        this.$message.error('上传头像图片只能是 JPG 格式!')
      }
      if (!isLt2M) {
        this.$message.error('上传头像图片大小不能超过 2MB!')
      }
      return isJPG && isLt2M
    },
  },
}
</script>
<style scoped>
.lookResume {
  width: 100%;
  height: 100%;
}
.lookResume-upload {
  width: 600px;
  height: 600px;
  margin: 0 auto;
  border: 1px solid #000;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>